package cn.xspace.module.other.http.req;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.xspace.android.xafcommon.network.message.ARequestMsg;
import com.xspace.android.xafcommon.util.Constants;
import com.xspace.android.xafcommon.util.LogUtils;

import java.util.HashMap;
import java.util.Map;


/**
 * 
 * @ClassName: UpdateUserInfoReq
 * @author:mawen
 * @Date：2014-3-3
 * @version V1.0.0
 * @Description: 更新用户账号信息
 */
public class ModifyUserInfoReq extends ARequestMsg {
	public String accountID;
	public String logo;
	public String sex;
	public String address;
	public String desc;

	@Override
	public String getURL() {
		return Constants.URL_MODIFY_USERINFO;
	}

	@Override
	protected byte[] toBytes() {
		Map<String,Object> dataMap = new HashMap();
		dataMap.put("uuid",accountID);
		if(!TextUtils.isEmpty(logo)){
			dataMap.put("logo",logo);
		}
		if(!TextUtils.isEmpty(sex)){
			dataMap.put("sex",sex);
		}
		if(!TextUtils.isEmpty(address)){
			dataMap.put("area_code",address);
		}
		if(!TextUtils.isEmpty(desc)){
			dataMap.put("desc",desc);
		}
		String value = new Gson().toJson(dataMap);
		LogUtils.d("QueryUserInfo==>" + value);
		return value.getBytes();
	}

	/*
	 * <p>Title: toJson</p> <p>Description: </p>
	 * 
	 * @return
	 * 
	 * @see com.xspace.android.xafcommon.network.message.ARequestMsg#toJson()
	 */
	@Override
	protected String toJson() {
		return null;
	}

}
